<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>社交地图</title>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=VhkT6V7yA3ieLfrjtN57hroWRgqIx9vO"></script>
    <script src="../lib/jquery-3.3.1.min.js"></script>
    <script src="../lib/thingjs.min-v1.2.2.4.js"></script>
    <script src="../lib/jquery.min.js"></script>
    <link rel="stylesheet" href="../lib/bootstrap-3.3.7-dist/css/bootstrap.min.css" />
    <script src="../lib/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>


    <style>
        body {
            margin:0;
            padding: 0;
        }
    </style>
</head>
<body>
<div style="margin-top: 2%">
<div class="container-fluid">
<!--<form action="#" th:action="@{/copy}" th:object="${copyScene}" method="post">-->

    <!--<div class="form-group">-->
        <!--<label>引用模板</label>-->
        <!--<input type="text" readonly="readonly" class="form-control" th:value="${copyScene.sName}">-->
    <!--</div>-->
    <!--<div class="form-group">-->
        <!--<label for="sName">场景名称</label>-->
        <!--<input type="text"  th:field="*{sName}" id="sName" class="form-control">-->
    <!--</div>-->
    <!--<div class="form-group">-->
        <!--<label for="sDescription">场景描述</label>-->
        <!--<input type="text"  th:field="*{sDescription}" id="sDescription"  class="form-control">-->
    <!--</div>-->

    <!--<a type="text" style="visibility: hidden;" th:field="*{sType}"  class="form-control"></a>-->
    <!--<a type="text" style="visibility: hidden;" th:field="*{sUrl}"  class="form-control"></a>-->

    <!--<button type="submit" class="btn btn-default">保存并编辑</button>-->
<!--</form>-->


    <div class="form-group">
        <label>引用模板  <a type="text"  style="visibility: hidden;" id="sType" th:text="${copyScene.sType}"></a></label>
        <input type="text" readonly="readonly" class="form-control" th:value="${copyScene.sName}">
    </div>
    <div class="form-group">
        <label for="sName">场景名称<a type="text"  style="visibility: hidden;" id="sId" th:text="${copyScene.sId}"></a></label>
        <input type="text"   id="sName"  name="sName" class="form-control">
    </div>
    <div class="form-group">
        <label for="sDescription">场景描述<a type="text"  style="visibility: hidden;" id="sUrl" th:text="${copyScene.sUrl}"></a></label>
        <input type="text"   id="sDescription" name="sDescription"  class="form-control">
    </div>

            <button onclick="abandon()"   class="btn btn-default" style="margin-left: 65%">放弃</button>
            <button onclick="ajaxSubmit()" class="btn btn-default">保存并编辑</button>





</div>
</div>
</body>
<script type="text/javascript" th:inline="javascript">

    /*<![CDATA[*/
    function ajaxSubmit(){
        var sId = $("#sId").text();
        var sName = $("#sName").val();
        var sType = $("#sType").text();
        var sDescription = $("#sDescription").val();
        var sUrl = $("#sUrl").text();

        $.ajax({
            url:"/copy1",
            type:'post',
            dataType: 'json',
            contentType: 'application/json',
            data: JSON.stringify({sId : sId,sName : sName,sDescription:sDescription,sType:sType,sUrl:sUrl}),
            async: true,
            success:function(data){
                alert("复制成功");
                window.parent.location.reload();
                var index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
            }
            });
    }


    function abandon(){
        window.parent.location.reload();
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
    }
</script>


